{$taxonomy}_pre_add_form
Action HookDescription
Fires before the Add Term form for all taxonomies. The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. Possible hook names include: - `category_pre_add_form` - `post_tag_pre_add_form`Hook Information
File Location |
wp-admin/edit-tags.php
View on GitHub
|
Hook Type | Action |
Line Number | 435 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$taxonomy
|
The taxonomy slug. |
Usage Examples
Basic Usage
<?php
// Hook into {$taxonomy}_pre_add_form
add_action('{$taxonomy}_pre_add_form', 'my_custom_function', 10, 1);
function my_custom_function($taxonomy) {
// Your custom code here
}
Source Code Context
wp-admin/edit-tags.php:435
- How this hook is used in WordPress core
<?php
430 *
431 * @since 3.0.0
432 *
433 * @param string $taxonomy The taxonomy slug.
434 */
435 do_action( "{$taxonomy}_pre_add_form", $taxonomy );
436 ?>
437
438 <div class="form-wrap">
439 <h2><?php echo $tax->labels->add_new_item; ?></h2>
440 <form id="addtag" method="post" action="edit-tags.php" class="validate"
PHP Documentation
<?php
/**
* Fires before the Add Term form for all taxonomies.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `category_pre_add_form`
* - `post_tag_pre_add_form`
*
* @since 3.0.0
*
* @param string $taxonomy The taxonomy slug.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-admin/edit-tags.php
Related Hooks
Related hooks will be displayed here in future updates.